Tambem gostaria !!!
UP
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

ngm?
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, 21, "Digite o comando correto.")
return true
end
local t = string.explode(param, ",")
player = getPlayerByName(t[1])
local condition = createConditionObject(CONDITION_MUTED)
if(not t[2] or t[2] == '') then
doPlayerSendTextMessage(cid, 21, "Digite o comando correto.")
end
if t[2] then
time = tonumber(t[2]*60000) -- 10*1000 is 10 seconds.
if(isPlayer(player) == TRUE and getPlayerGroupId(cid) > getPlayerGroupId(player) and getPlayerFlagValue(player, PLAYERFLAG_CANNOTBEMUTED) == false) then
setConditionParam(condition, CONDITION_PARAM_TICKS, time)
setConditionParam(condition, CONDITION_PARAM_SUBID, 4)
doAddCondition(player, condition)
doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "Voce foi silenciado no Help-Channel por " .. getPlayerName(cid) .. " por " .. t[2] .. " minuto(s).")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(player) .. " foi silenciado no Help-Channel por " .. t[2] .. " minuto(s).")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Jogador " .. t[1] .. " não existe ou não está online.")
end
end
return true
end
<talkaction log="yes" words="/mute;/desmute" access="1" event="script" value="muteplayer.lua"/>
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, 21, "Digite o comando correto.") return true end local t = string.explode(param, ",") player = getPlayerByName(t[1]) local condition = createConditionObject(CONDITION_MUTED) if(not t[2] or t[2] == '') then doPlayerSendTextMessage(cid, 21, "Digite o comando correto.") end if t[2] then time = tonumber(t[2]*60000) -- 10*1000 is 10 seconds. if(isPlayer(player) == TRUE and getPlayerGroupId(cid) > getPlayerGroupId(player) and getPlayerFlagValue(player, PLAYERFLAG_CANNOTBEMUTED) == false) then setConditionParam(condition, CONDITION_PARAM_TICKS, time) setConditionParam(condition, CONDITION_PARAM_SUBID, 4) doAddCondition(player, condition) doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "Voce foi silenciado no Help-Channel por " .. getPlayerName(cid) .. " por " .. t[2] .. " minuto(s).") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(player) .. " foi silenciado no Help-Channel por " .. t[2] .. " minuto(s).") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Jogador " .. t[1] .. " não existe ou não está online.") end end return true end<talkaction log="yes" words="/mute;/desmute" access="1" event="script" value="muteplayer.lua"/>
infelizmente não está mutando, parece que falta alguma config nas sources, como faço para add a config na source?
olha o erro que aprece
edit: uso tfs 0.3.6
[04/08/2015 13:23:42] [Error - TalkAction Interface] [04/08/2015 13:23:42] data/talkactions/scripts/muteplayer.lua:onSay [04/08/2015 13:23:42] Description: [04/08/2015 13:23:42] (luaSetConditionParam) This function can only be used while loading the script. [04/08/2015 13:23:42] [Error - TalkAction Interface] [04/08/2015 13:23:42] data/talkactions/scripts/muteplayer.lua:onSay [04/08/2015 13:23:42] Description: [04/08/2015 13:23:42] (luaDoAddCondition) Condition not found
Editado Agosto 4 por roriscrave
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

function onSay(cid, words, param, channel, ConditionParam, AddCondition)
if(param == '') then
doPlayerSendTextMessage(cid, 21, "Digite o comando correto.")
return true
end
local t = string.explode(param, ",")
player = getPlayerByName(t[1])
local condition = createConditionObject(CONDITION_MUTED)
if(not t[2] or t[2] == '') then
doPlayerSendTextMessage(cid, 21, "Digite o comando correto.")
end
if t[2] then
time = tonumber(t[2]*60000) -- 10*1000 is 10 seconds.
if(isPlayer(player) == TRUE and getPlayerGroupId(cid) > getPlayerGroupId(player) and getPlayerFlagValue(player, PLAYERFLAG_CANNOTBEMUTED) == false) then
setConditionParam(condition, CONDITION_PARAM_TICKS, time)
setConditionParam(condition, CONDITION_PARAM_SUBID, 4)
doAddCondition(player, condition)
doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "Voce foi silenciado no Help-Channel por " .. getPlayerName(cid) .. " por " .. t[2] .. " minuto(s).")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(player) .. " foi silenciado no Help-Channel por " .. t[2] .. " minuto(s).")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Jogador " .. t[1] .. " não existe ou não está online.")
end
end
return true
end
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

function onSay(cid, words, param)
local CHANNEL_HELP = 7
local storage = 456112
if words == "/mute" then
local mute = param:split(",")
if mute[1] == nil or mute[1] == " " then
doPlayerSendCancel(cid, "Informe o jogador.")
return false
end
if mute[2] == nil or mute[2] == " " then
doPlayerSendCancel(cid, "Informe o tempo em minutos.")
return false
end
local target = getPlayerByName(mute[1])
local time = tonumber(mute[2])
local condition = createConditionObject(CONDITION_MUTED)
setConditionParam(condition, CONDITION_PARAM_SUBID, CHANNEL_HELP)
setConditionParam(condition, CONDITION_PARAM_TICKS, time * 60 * 1000)
if not target then
doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
return false
end
doAddCondition(target, condition)
doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. time .. " minutos.")
setPlayerStorageValue(target, storage, 1)
return false
elseif words == "/unmute" then
local remove = getPlayerByName(param)
if not remove then
doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
return false
end
if getPlayerStorageValue(remove, storage) == 1 then
doRemoveCondition(remove, CONDITION_MUTED, CONDITIONID_DEFAULT, CHANNEL_HELP)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador " .. getCreatureName(remove) .. ".")
setPlayerStorageValue(target, storage, -1)
else
doPlayerSendCancel(cid, "O jogador " .. getCreatureName(remove) .. " nao esta mutado.")
end
end
return false
end
Editado Agosto 4 por Bruno Minervino
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

@Kissy
deu o mesmo erro acima
deu o mesmo erro acima
deu esse error:[04/08/2015 13:34:32] [Error - TalkAction Interface][04/08/2015 13:34:32] data/talkactions/scripts/muteplayer.lua:onSay[04/08/2015 13:34:32] Description:[04/08/2015 13:34:32] data/talkactions/scripts/muteplayer.lua:4: attempt to call global 'Player' (a nil value)[04/08/2015 13:34:32] stack traceback:[04/08/2015 13:34:32] data/talkactions/scripts/muteplayer.lua:4: in function <data/talkactions/scripts/muteplayer.lua:1>
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

@Kissy
function onSay(cid, words, param, player)
local CHANNEL_HELP = 7
local player = Player(cid)
local storage = 456112
if words == "/mute" then
local mute = param:split(",")
if mute[1] == nil or mute[1] == " " then
player:sendCancelMessage("Invalid player specified.")
return false
end
if mute[2] == nil or mute[2] == " " then
player:sendCancelMessage("Invalid time specified.")
return false
end
local target = Player(mute[1])
local time = tonumber(mute[2])
local condition = Condition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT)
condition:setParameter(CONDITION_PARAM_SUBID, CHANNEL_HELP)
condition:setParameter(CONDITION_PARAM_TICKS, time*60*1000)
if player:getAccountType() < ACCOUNT_TYPE_TUTOR then
return false
end
if target == nil then
player:sendCancelMessage("A player with that name is not online.")
return false
end
if target:getAccountType() >= ACCOUNT_TYPE_TUTOR then
player:sendCancelMessage("Only player can be mutated")
return false
end
target:addCondition(condition)
sendChannelMessage(CHANNEL_HELP, TALKTYPE_CHANNEL_R1, target:getName() .. " has been muted by " .. player:getName() .. " for using Help Channel inappropriately.")
target:setStorageValue(storage, 1)
return false
end
if words == "/unmute" then
local remove = Player(param)
if player:getAccountType() < ACCOUNT_TYPE_TUTOR then
return false
end
if remove == nil then
player:sendCancelMessage("A player with that name is not online.")
return false
end
if remove:getAccountType() >= ACCOUNT_TYPE_TUTOR then
return false
end
if remove:getStorageValue(storage) == 1 then
remove:removeCondition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT, CHANNEL_HELP)
sendChannelMessage(CHANNEL_HELP, TALKTYPE_CHANNEL_R1, remove:getName() .. " has been unmuted by " .. player:getName() .. ".")
remove:setStorageValue(storage, -1)
else
player:sendCancelMessage("A player " .. remove:getName() .. "is not mutated")
end
end
return false
end
arrumei o do bruno veja cê vai funcionar
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

arrumei o do bruno veja cê vai funcionar
Ele não usa tfs 1.x, é o costume de fazer....
@@roriscrave, eu editei meu script, pega ele lá...
info
Grupo: Marquês
Registrado: 03/02/13
Posts: 1.2k
Reputação: +254
Gênero: Masculino
Char no Tibia: Partiu Baladinha

@Bruno Minervino
nessa linha:
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você foi mutado por " .. time .. " minutos.")
O correto não seria:
doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. time .. " minutos.")
Porque no script não está declarado "player" e sim "target".
Se eu tiver errado, desculpe.
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

@Bruno Minervino
nessa linha:
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você foi mutado por " .. time .. " minutos.")O correto não seria:
doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. time .. " minutos.")Porque no script não está declarado "player" e sim "target".Se eu tiver errado, desculpe.
You're right.
Thank you bro!
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

function onSay(cid, words, param, channel, ConditionParam, AddCondition) if(param == '') then doPlayerSendTextMessage(cid, 21, "Digite o comando correto.") return true end local t = string.explode(param, ",") player = getPlayerByName(t[1]) local condition = createConditionObject(CONDITION_MUTED) if(not t[2] or t[2] == '') then doPlayerSendTextMessage(cid, 21, "Digite o comando correto.") end if t[2] then time = tonumber(t[2]*60000) -- 10*1000 is 10 seconds. if(isPlayer(player) == TRUE and getPlayerGroupId(cid) > getPlayerGroupId(player) and getPlayerFlagValue(player, PLAYERFLAG_CANNOTBEMUTED) == false) then setConditionParam(condition, CONDITION_PARAM_TICKS, time) setConditionParam(condition, CONDITION_PARAM_SUBID, 4) doAddCondition(player, condition) doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "Voce foi silenciado no Help-Channel por " .. getPlayerName(cid) .. " por " .. t[2] .. " minuto(s).") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(player) .. " foi silenciado no Help-Channel por " .. t[2] .. " minuto(s).") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Jogador " .. t[1] .. " não existe ou não está online.") end end return true end
function onSay(cid, words, param) local CHANNEL_HELP = 7 local storage = 456112 if words == "/mute" then local mute = param:split(",") if mute[1] == nil or mute[1] == " " then doPlayerSendCancel(cid, "Informe o jogador.") return false end if mute[2] == nil or mute[2] == " " then doPlayerSendCancel(cid, "Informe o tempo em minutos.") return false end local target = getPlayerByName(mute[1]) local time = tonumber(mute[2]) local condition = createConditionObject(CONDITION_MUTED) setConditionParam(condition, CONDITION_PARAM_SUBID, CHANNEL_HELP) setConditionParam(condition, CONDITION_PARAM_TICKS, time * 60 * 1000) if not target then doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.") return false end doAddCondition(target, condition) doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. time .. " minutos.") setPlayerStorageValue(target, storage, 1) return false elseif words == "/unmute" then local remove = getPlayerByName(param) if not remove then doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.") return false end if getPlayerStorageValue(remove, storage) == 1 then doRemoveCondition(remove, CONDITION_MUTED, CONDITIONID_DEFAULT, CHANNEL_HELP) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador " .. getCreatureName(remove) .. ".") setPlayerStorageValue(target, storage, -1) else doPlayerSendCancel(cid, "O jogador " .. getCreatureName(remove) .. " nao esta mutado.") end end return false end
Não sei porque mas infelizmente ainda ta dando error, os 2 scripts deram o mesmo error agora:
Bruno Minervino e Kissy deu esse error:
[04/08/2015 18:32:17] [Error - TalkAction Interface] [04/08/2015 18:32:17] data/talkactions/scripts/muteplayer.lua:onSay [04/08/2015 18:32:17] Description: [04/08/2015 18:32:17] data/talkactions/scripts/muteplayer.lua:4: attempt to call global 'player' (a nil value) [04/08/2015 18:32:17] stack traceback: [04/08/2015 18:32:17] data/talkactions/scripts/muteplayer.lua:4: in function <data/talkactions/scripts/muteplayer.lua:1>
info
Grupo: Marquês
Registrado: 03/02/13
Posts: 1.2k
Reputação: +254
Gênero: Masculino
Char no Tibia: Partiu Baladinha

Não sei porque mas infelizmente ainda ta dando error, os 2 scripts deram o mesmo error agora:
Bruno Minervino e Kissy deu esse error:
[04/08/2015 18:32:17] [Error - TalkAction Interface] [04/08/2015 18:32:17] data/talkactions/scripts/muteplayer.lua:onSay [04/08/2015 18:32:17] Description: [04/08/2015 18:32:17] data/talkactions/scripts/muteplayer.lua:4: attempt to call global 'player' (a nil value) [04/08/2015 18:32:17] stack traceback: [04/08/2015 18:32:17] data/talkactions/scripts/muteplayer.lua:4: in function <data/talkactions/scripts/muteplayer.lua:1>
Você fez algo errado... tente novamente com esse:
function onSay(cid, words, param)
local CHANNEL_HELP = 7
local storage = 456112
if words == "/mute" then
local mute = param:split(",")
if mute[1] == nil or mute[1] == " " then
doPlayerSendCancel(cid, "Informe o jogador.")
return false
end
if mute[2] == nil or mute[2] == " " then
doPlayerSendCancel(cid, "Informe o tempo em minutos.")
return false
end
local target = getPlayerByName(mute[1])
local time = tonumber(mute[2])
local condition = createConditionObject(CONDITION_MUTED)
setConditionParam(condition, CONDITION_PARAM_SUBID, CHANNEL_HELP)
setConditionParam(condition, CONDITION_PARAM_TICKS, time * 60 * 1000)
if not target then
doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
return false
end
doAddCondition(target, condition)
doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. time .. " minutos.")
setPlayerStorageValue(target, storage, 1)
return false
elseif words == "/unmute" then
local remove = getPlayerByName(param)
if not remove then
doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
return false
end
if getPlayerStorageValue(remove, storage) == 1 then
doRemoveCondition(remove, CONDITION_MUTED, CONDITIONID_DEFAULT, CHANNEL_HELP)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador " .. getCreatureName(remove) .. ".")
setPlayerStorageValue(target, storage, -1)
else
doPlayerSendCancel(cid, "O jogador " .. getCreatureName(remove) .. " nao esta mutado.")
end
end
return false
end
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

Você fez algo errado... tente novamente com esse:
Fawz, o seu ta dando o seguinte erro:
Teste é o nome do jogador
se eu falar /mute Teste, aparece a mensagem:
Informe o tempo em minutos
Se eu falar /mute Teste,1 aparece a mensagem:
Informe o jogador
Sendo que o jogador e o tempo ja foram informados!





info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei
Quero um comando que ao mutar o jogador, ele tome muted APENAS NO HELP. Quero que ele possa falar nos outros chats normalmente, mas no help só depois que sair esse mute.
> Eu sei que tem o tempo de 2min para falar no help, mas tem player que fica zuando no help, ai usaria o comando para banir por X horas por exemplo.
Tentei usar esse do , mas ele muta em todos channels, ate no default, fazendo o player morrer sem poder usar magias
http://www.xtibia.com/forum/topic/181749-talk-comando-mute-atualizado/
Editado Julho 27 por Bruno Minervino